@extends('admin.layout')
@section('title')
 角色添加
@endsection
@section('body')
 <div class="widget-body">
 @if(!isset($role))
  {{ Form::open(array('class' => 'am-form form-horizontal bv-form','enctype' => 'multipart/form-data')) }}
 @else
  {{ Form::model($role,array('class' => 'am-form form-horizontal bv-form','enctype' => 'multipart/form-data')) }}
  <input type="hidden" value="{{$role['id']}}" name="id"/>
 @endif
   <div class="form-title">
    角色添加
   </div>
   <div class="form-group has-feedback">
    <label class="col-lg-2 control-label">角色名:</label>
    <div class="col-lg-5">
     {!! Form::text('name') !!}
    </div>
   </div>
   <div class="form-group has-feedback">
    <label class="col-lg-2 control-label">状 态:</label>
    <div class="col-lg-5">
       <label>
        <input type="radio" class="colored-blue" name="status" value="0" {{isset($role['status']) && $role['status']==0?'checked':''}}>
        <span class="text"> 禁用</span>
       </label>
       <label>
        <input type="radio" class="colored-blue" name="status" value="1" {{!isset($role['status']) || $role['status']==1?'checked':''}}>
        <span class="text">正常</span>
       </label>
    </div>
   </div>

     <div class="form-group has-feedback">
        <div class="col-lg-2 control-label">
         <span class="widget-caption">权限:</span>
        </div>
         <div>
            <div class="checkbox">
            @foreach($nodes as $key => $node)
              <label>
               <input type="checkbox" value="{{$node['id']}}" name="nodes[]" {{(isset($node['is_checked']) && $node['is_checked'])?'checked':''}}>
               <span class="text">{{$node['name']}}</span>
              </label>
            @endforeach
           </div>
         </div>
     </div>

   <div class="form-group">
    <div class="col-lg-offset-2 col-lg-8">
     <input type="submit" value="确定" class="btn btn-palegreen">
    </div>
   </div>
   {!! Form::close() !!}
 </div>
@endsection